#if !defined(AFX_SCOPE1_H__20373609_0B81_493C_8F94_B4644298A84F__INCLUDED_)
#define AFX_SCOPE1_H__20373609_0B81_493C_8F94_B4644298A84F__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// Scope1.h : header file
//

#include <list>
#include <iterator>
//using std::list;
//using std::iterator;
class CScope : public CStatic
{
// Construction
public:
	CScope();
// Attributes
public:
// Operations
public:
	void AddValue(double dTime,double dValue);
	void AddValue(double dTime,double dValue1,double dValue2,double dValue3,double dValue4);
	void AddValue(double dTime,double dValue1,double dValue2,double dValue3);
	void AddValue(double dTime,double dValue1,double dValue2);
	void Clear();
	void UpdateCurve();
	void SetDimT(double newDimT);
	void SetDimy(double newDimY);
	void SetBase(int nNewABase,int nRange);
	void SetXAxisZeroPoint(CString StartOfXAxis);
	void SetCenterOfYAxis(CString CenterOfYAxis);
private:
	int ConvertTimeToAxisX(double dTime);
	int ConvertValueToAxisY(double dValue);
	void DrawCurvePanel(CDC *pDC);
	void DrawButtonPanel(CDC *pDC);
	void DrawGrid(CDC *pDC);
	void DrawCurve(CDC *pDC);
	void DrawAxis(CDC *pDC);
	void DrawTrack(CDC *pDC,BOOL bPressed);
	void DrawArrow(CDC *pDC,int nIndex,BOOL bLighted);
	void DrawButtonArea(CDC *pDC,int nIndex,BOOL bLighted);
	
private:
	
	
	CRect	m_rectCurve;
	CRect	m_rectValue;
	CRect   m_rectCurvePanel;
	CRect   m_rectButtonPanel;
	CRect   m_rectScroll;

	CRgn	m_rgnCurve;
	CRgn	m_rgnYPlus;
	CRgn	m_rgnYMinus;
	CRgn	m_rgnTPlus;
	CRgn	m_rgnTMinus;
    

	
	CBrush  m_BkBrush;
	CBrush  m_PanelBrush;
	CBrush  m_CurveBrush;

	CBrush m_ButtonPanelBrush;

	CPen    m_PenCurve1;
    CPen    m_PenCurve2;
	CPen    m_PenCurve3;
	CPen    m_PenCurve4;

	CPen    m_PenGrid;
	CPen    m_PenBrightLine;
	CPen    m_PenDarkLine;

	CFont   m_FontTitle;
	CFont   m_FontButton;
	CFont   m_FontAxis;
	
	   
	double  m_dDimT;
	double  m_dDimY;
	double  m_dValue;

	int		m_nBase;
	int		m_nRange;
	int     m_nArrowIndex;

	BOOL    m_bPressed;
	BOOL	m_bDrawing;

	CBitmap m_bitmapTitle;
	CBitmap m_bitmapTrack;

	std::list<double> m_TimeList;
	std::list<double> m_ValueList1;
    std::list<double> m_ValueList2;
	std::list<double> m_ValueList3;
	std::list<double> m_ValueList4;

	int numberofYgrid;
	int numberofXgrid;
	CString centervalueofYAxis;
    CString centervalueofXAxis;
    CString startvalueofXAxis;

    POINT PointLeftTop;
    BOOL PointDown;

	CString m_strButton1Name;
	CString m_strButton2Name;
	CString m_strButton3Name;
	CString m_strButton4Name;
	CString m_strButton5Name; //default

    CRgn    m_rgnButton1;
	CRgn    m_rgnButton2;
	CRgn    m_rgnButton3;
	CRgn    m_rgnButton4;
	CRgn    m_rgnButton5;

	BOOL OnOffChannel1;
	BOOL OnOffChannel2;
	BOOL OnOffChannel3;
	BOOL OnOffChannel4;
	long ShowChannel;
// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CScope)
	protected:
	virtual void PreSubclassWindow();
	//}}AFX_VIRTUAL

// Implementation
public:
	

	virtual ~CScope();

	// Generated message map functions
protected:
	
	//{{AFX_MSG(CScope)
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	afx_msg void OnPaint();
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	afx_msg UINT OnNcHitTest(CPoint point);
	afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
	afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
	//}}AFX_MSG

	DECLARE_MESSAGE_MAP()


};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_SCOPE1_H__20373609_0B81_493C_8F94_B4644298A84F__INCLUDED_)
